<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h5 class="modal-title">输入框</h5>
</div>

<div class="modal-body" style="height: 70px">
    <div class="form-group">
        <label class="col-lg-3 control-label" style="text-align: right">数字</label>
        <div class="col-lg-5">
            <input type="number" class="form-control" name="number" id="number"/>
        </div>
    </div>
</div>

<div class="modal-footer" style="text-align: center">
    <button type="button" class="btn btn-default" onclick="closeModel()">关闭
    </button>
    <button type="button" class="btn btn-primary" onclick="confirmModel()">确定
    </button>
</div>

<script>
    function closeModel() {
        $("#number").val("");
        $("#modal_number").modal('hide');
    }

    function confirmModel() {
        var number = $("#number").val();
        $("#modal_number").modal('hide');

        var value_text = $("#formulaArea").val().trim();
        $("#formulaArea").val('');
        $("#formulaArea").val(value_text + number);

        var value_text2 = $("#touchExpression").val().trim();
        $("#touchExpression").val('');
        $("#touchExpression").val(value_text2 + number);

        $("#number").val("");
    }
</script>